UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'v0JiE++pNMSjzeLwx7hnYmNHKEUOUN2EU/tn6PuAL1g='
WHERE
key_id = 'b3acfd426313c0800a02324f6acb4582a380d812f1967fb91e8d80191ef74e6b'
AND (
token = 'v0JiE++pNMSjzeLwx7hnYmNHKEUOUN2EU/tn6PuAL1g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)