UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Oa6mK3bdIvg9Hwj/ofLEJC5H1RTAUEaleseHpKwCwS0=' 
WHERE 
  key_id = 'd45d5bedbad8262163ffaf3657088c70930128c905f5eeaa1aed9ed02ccfad5c' 
  AND (
    token = 'Oa6mK3bdIvg9Hwj/ofLEJC5H1RTAUEaleseHpKwCwS0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023