UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XeKSJRef5YlFu+lOWx6c6DsZgw3psbzGKsXf7e5Xk/Y=' 
WHERE 
  key_id = '960042b13dc7ec64a30d2e5000604697f787c8dff37dc606dc08f6a70e7fd449' 
  AND (
    token = 'XeKSJRef5YlFu+lOWx6c6DsZgw3psbzGKsXf7e5Xk/Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040