UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2cRP0EjozECcP06nK/DSN+WKPakntB/TUR9u1sWKXkk=' 
WHERE 
  key_id = '3c10f05eab948c03bcfeb1f0a7d20577e99d263ba9f0431008e7f59b9dd6331e' 
  AND (
    token = '2cRP0EjozECcP06nK/DSN+WKPakntB/TUR9u1sWKXkk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044