UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'M7B0/AfImd/P9/5Sz6vZU8io6Dn+mFkWT/Xqyyy28YU='
WHERE
key_id = 'a0eabcf429a34ce305998c1041e0acf1c8932d9ee48680b957e0610984abd881'
AND (
token = 'M7B0/AfImd/P9/5Sz6vZU8io6Dn+mFkWT/Xqyyy28YU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)