UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gAMP90EbLqzP7UxfavWXKoMUB/teSIiA0yzOyjS7pEQ=' 
WHERE 
  key_id = '63fb9a0b149afd9fe8f243a1a9f5f96cc913e208548ffa5b7071013865d47c2b' 
  AND (
    token = 'gAMP90EbLqzP7UxfavWXKoMUB/teSIiA0yzOyjS7pEQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032