UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'o7+jjzj4Qa3dflnxiMqovY+P4Gib0Hwy+JeR/U53tr4='
WHERE
key_id = 'f00514b591dc5b7e40dd118f9ba27fabee5fe45ee97ae373d11fb5a3a434a9c6'
AND (
token = 'o7+jjzj4Qa3dflnxiMqovY+P4Gib0Hwy+JeR/U53tr4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)