UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TNJvG9zFayj/v8HGQ6wzl5sLQ3DlhLac66Ncuuf4olo=' 
WHERE 
  key_id = '2183633d72d3e595a5e96219bf5988dd9ec710700f6ef422877d1cb7e9c0c8e2' 
  AND (
    token = 'TNJvG9zFayj/v8HGQ6wzl5sLQ3DlhLac66Ncuuf4olo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031