UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'l8iA6LNIulwjRE627SkZts0Td32scU4xuQ+DK4yavVk=' 
WHERE 
  key_id = 'e62c4a8d6428b53da678cfb289a800b0c6dac69eedf0f3e640b5a038990b0542' 
  AND (
    token = 'l8iA6LNIulwjRE627SkZts0Td32scU4xuQ+DK4yavVk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020