UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'i3Qo7Pu7KqiuF1uzi4+7Uowd3/fh9a5/iqHq4G8BnW0=' 
WHERE 
  key_id = '1cdc0a3e6cc9ee2fc93367230a179826b977fe33adff70945c9a85697506e02f' 
  AND (
    token = 'i3Qo7Pu7KqiuF1uzi4+7Uowd3/fh9a5/iqHq4G8BnW0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037