UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ulOu23dWmTP46xngwbxFdNnRVoHQSJU1141ivHVfMJ0='
WHERE
key_id = '458f73b81a98c1a357a462d6c37687926c2cf218998db3853e2dd532600f0f60'
AND (
token = 'ulOu23dWmTP46xngwbxFdNnRVoHQSJU1141ivHVfMJ0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)