UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8X7x28cszTwA+sq+g1fwiKJeckltgN617uuLeGmDqjY=' 
WHERE 
  key_id = '669831b5dbf6c8f80f0ca791a4073d8e882a7136d06874e0ae4cbff606afa1d1' 
  AND (
    token = '8X7x28cszTwA+sq+g1fwiKJeckltgN617uuLeGmDqjY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019