UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'swawuXAN/mj2l3sVGIFHDu61r1N8+R+YfSFXnKKXkKw='
WHERE
key_id = '7c1e991d8fc48f2a8ef37dac3796e8029aa84d51bab9498ccf5e2ea17d2ab209'
AND (
token = 'swawuXAN/mj2l3sVGIFHDu61r1N8+R+YfSFXnKKXkKw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)