UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GtV3EQuZWIv70dEul9Ke2a/N1irp9KFHWqQvsnptDUE='
WHERE
key_id = '92cc843f284fa7d1d7860926af5d8a4190c73eeab1c903b9e7310d50b7d2edde'
AND (
token = 'GtV3EQuZWIv70dEul9Ke2a/N1irp9KFHWqQvsnptDUE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)