UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Yt2P5oT944WnWNy3UU6+6vR5NlRHL5nYHtXmSb/5Es0=' 
WHERE 
  key_id = '3e770c979b7bb4d1a100d6ccd5f7a62e9f22d825ca99d7102f853a39b47df280' 
  AND (
    token = 'Yt2P5oT944WnWNy3UU6+6vR5NlRHL5nYHtXmSb/5Es0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041