UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UDLXoDxDWGOXsQ8cdMHUp6552xShUm+2CsdxQ/AsuTk=' 
WHERE 
  key_id = '9d56422940fcf60765c75181dd391f7b31f9b06ee095092430147a5311f1db43' 
  AND (
    token = 'UDLXoDxDWGOXsQ8cdMHUp6552xShUm+2CsdxQ/AsuTk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029