UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QWHaP6uqe9ZVDxfjGkwVuS/Cxa09qQaaK7R7W8rfIAE=' 
WHERE 
  key_id = '39bf0bce2e4dbd1e6b91c5f7fa0eec003dc379b4f0aa01caf727a2d20db724fc' 
  AND (
    token = 'QWHaP6uqe9ZVDxfjGkwVuS/Cxa09qQaaK7R7W8rfIAE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024