UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3uDqRkufkgoq3VspgwhZcmIslpFqbqkZ0o6hrBWMEtI='
WHERE
key_id = '1f8ddfa7478e84602047f11b2fa6c4cf4afb88ee43ea9b53e3f2fbd34dcfa663'
AND (
token = '3uDqRkufkgoq3VspgwhZcmIslpFqbqkZ0o6hrBWMEtI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)