UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iejw7YvYQBL/0M26AD6kAZrUYg3QEJkXxCjI1a6jcOw=' 
WHERE 
  key_id = 'cc083ff17d014cc50cc1a0346ef4e4f7ccf18ac34ba8659c6ff6eecae7e7e93f' 
  AND (
    token = 'iejw7YvYQBL/0M26AD6kAZrUYg3QEJkXxCjI1a6jcOw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025