UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/rgMlldy3ga3Pmie4/b/myoO8RxsoGGSpYk4qfTTAG8='
WHERE
key_id = '4b00e6e2ebf5631720a56f6da5797a4ad8160d84d82ab3ad97aac1ea70b5971a'
AND (
token = '/rgMlldy3ga3Pmie4/b/myoO8RxsoGGSpYk4qfTTAG8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)