UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'P4sELwA0tvsWdACZi0suTfOQerHJXXyF3IVuN1g7RGE=' 
WHERE 
  key_id = 'a292eda3de32313894fa2fd6dc29e1d419641fd613cc20df3cf8acf7f3cce6e4' 
  AND (
    token = 'P4sELwA0tvsWdACZi0suTfOQerHJXXyF3IVuN1g7RGE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024