UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wvfWLx8fe0BGVJ9IdQu9lRpDKhJiLimeSylEoE6IZfg='
WHERE
key_id = '52c22c9a6b30fe53b274be0555d4fa969c3592392c030d507c4d40e80d3e55ff'
AND (
token = 'wvfWLx8fe0BGVJ9IdQu9lRpDKhJiLimeSylEoE6IZfg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)