UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0ewotPjrkub2+qYXDymfYUP6XrNG0WG/uA8GwjcmEzU=' 
WHERE 
  key_id = '9b2bf8d67ce334f8d407ac1b16abdf45c8c90707f7eba333023ee366223b17c4' 
  AND (
    token = '0ewotPjrkub2+qYXDymfYUP6XrNG0WG/uA8GwjcmEzU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025