UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SzHsqOwOOO0rjwxYNoV3Cfjo6f8bXni9OcWinAbFM/g=' 
WHERE 
  key_id = '4bf4a460263b914ba0526f8212c6aa0c3f760d157127633784373591e10d84ab' 
  AND (
    token = 'SzHsqOwOOO0rjwxYNoV3Cfjo6f8bXni9OcWinAbFM/g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033