UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sOsv8IbCzrodSzwcbNGsGQJZRt/I0kDc6O8bPvC6VB4=' 
WHERE 
  key_id = '9eefb75aa54cbdc201cefd654104b4a4cf6d65a43fa51de703fffcf15cc129ba' 
  AND (
    token = 'sOsv8IbCzrodSzwcbNGsGQJZRt/I0kDc6O8bPvC6VB4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027