UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LeW38+e1kBXzfSAPXCEXiUwkqtyG+SgGUMGcozvx8TE=' 
WHERE 
  key_id = '27a68834434f03ab48760d0bea6c1243b6f803a65a548dbc079e305e8b62fba1' 
  AND (
    token = 'LeW38+e1kBXzfSAPXCEXiUwkqtyG+SgGUMGcozvx8TE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028