UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UWEQMeDlprqUkKdigLW3pe004L2ilViHglnpHJS79LY=' 
WHERE 
  key_id = 'c2cbda3c5f1c7aa680f78a8d3242c92041363a1f5c6ceb940e46fb7035b507b4' 
  AND (
    token = 'UWEQMeDlprqUkKdigLW3pe004L2ilViHglnpHJS79LY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028