UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kRyXn5ebrJGp/mPwH6ty3yeJYoVdFVzexecCWK28Bqc=' 
WHERE 
  key_id = 'c504dbef3a820ea007d1d5bbd505bf5c91420ed77c42c1293f2222d670397edd' 
  AND (
    token = 'kRyXn5ebrJGp/mPwH6ty3yeJYoVdFVzexecCWK28Bqc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018