UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zr8qM7F1QCdy5NMyMMEYqwQjhb376+4aSkMOPpvN1aA=' 
WHERE 
  key_id = '70a6a0235567b98c8b730828750f00d22b854aeea2edeb097428182a8651e734' 
  AND (
    token = 'zr8qM7F1QCdy5NMyMMEYqwQjhb376+4aSkMOPpvN1aA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039