UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QGs/36/uqf/JEiGSSCph59BBjFEEgHOIiF7oVMJ6AWc=' 
WHERE 
  key_id = 'a61573eb5035f6c08ce3f19a3f20d99a29abd1b302ddc9bb4dbd7898f6c75d46' 
  AND (
    token = 'QGs/36/uqf/JEiGSSCph59BBjFEEgHOIiF7oVMJ6AWc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044