UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Dg/9fJGwu/iDL5GQVM6zOWi87N8lHLebIW88G8+Q7BE=' 
WHERE 
  key_id = '41e4c1b13b4ee6a93332ae85122e905696e20860029db8080868f7a52c1b20b3' 
  AND (
    token = 'Dg/9fJGwu/iDL5GQVM6zOWi87N8lHLebIW88G8+Q7BE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021