UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LY+UO7SIMwWACpHMmP6tSDNEwHhJtSMciUc1Ix7hpQk=' 
WHERE 
  key_id = '9818312a8e892000621223cec522187eed18ecafb3893a55ca34c3e8375b51b7' 
  AND (
    token = 'LY+UO7SIMwWACpHMmP6tSDNEwHhJtSMciUc1Ix7hpQk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055