UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'A0T+88YX4PyTJeGrmkjYWlY4q2Tc1GYUM4bQJHZkOwY=' 
WHERE 
  key_id = '2d05ac1df1fcd9e4553f7b24c2c57afb24f3461bf9aadfc7109038c09ee1387f' 
  AND (
    token = 'A0T+88YX4PyTJeGrmkjYWlY4q2Tc1GYUM4bQJHZkOwY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033