UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HgZ7/z4iz0GrHd9bgNWEWUEgyeJGbXtNOyJgNrsn05o=' 
WHERE 
  key_id = '61285056dd6944dc6939fb5f0bc148523da2f64320e2e6cbf19c16728fbd4544' 
  AND (
    token = 'HgZ7/z4iz0GrHd9bgNWEWUEgyeJGbXtNOyJgNrsn05o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030