UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bFGRUQXsxb6INumFlMZQS9B8DjjReTm2O44Izj+jTJY=' 
WHERE 
  key_id = '793201f73df8d7460a0bec7926d10d926b128a1c4749b0a91d4bcc6ab67a60d0' 
  AND (
    token = 'bFGRUQXsxb6INumFlMZQS9B8DjjReTm2O44Izj+jTJY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043