UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pNbeZ3tdrdUr4v3CG/6FYL4l9xzzyAB51i55CyeR094='
WHERE
key_id = '4128281d9c7a4a5b0113c2957852295a7af598b9dd1da9917b9d850520200241'
AND (
token = 'pNbeZ3tdrdUr4v3CG/6FYL4l9xzzyAB51i55CyeR094='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)