UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'P+hPjIm8/jRYmDqiU/iSMCJNcKCJZgYiGaGVMNAQfP0=' 
WHERE 
  key_id = 'ee2de0772fbad3d08abb7a9a289cd5b8b8573cb3d78096bc9889d5b1e1778a42' 
  AND (
    token = 'P+hPjIm8/jRYmDqiU/iSMCJNcKCJZgYiGaGVMNAQfP0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024