UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+Njs34sGmnKqimeWxLFxtFYzO3aZH5fsjhs/EByzGV0='
WHERE
key_id = 'f7a658a5334942b3371222828a89dbecf4516e4bd106c4a5ebcc722d9433bd61'
AND (
token = '+Njs34sGmnKqimeWxLFxtFYzO3aZH5fsjhs/EByzGV0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)