UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iIubum2yf/XpXJec/uxLUdYUZjkj1h367UkD5eG1oCQ=' 
WHERE 
  key_id = '127338e7b9328c615123733bec96b1807b321805fa470f22e5fb9b6727916df2' 
  AND (
    token = 'iIubum2yf/XpXJec/uxLUdYUZjkj1h367UkD5eG1oCQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024