UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aqQ73uH5mHbMgOWSU4lkKI4GtQUo/GrSYzwA06xOQgo='
WHERE
key_id = '65a898da28fd0a007d25a803d3179e3376fd4b4e90b716c674df747a3acca5fa'
AND (
token = 'aqQ73uH5mHbMgOWSU4lkKI4GtQUo/GrSYzwA06xOQgo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)