UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dDnh84XnvTTu2OPnh0vaFPyEQ9z5vueEeJnIJDNBbhg=' 
WHERE 
  key_id = '371a4ae6d9b5a33d5a887fbefe75195d9192c2b3a18c0af4100d86c54e29b9f5' 
  AND (
    token = 'dDnh84XnvTTu2OPnh0vaFPyEQ9z5vueEeJnIJDNBbhg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024