UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2xd7z1sPNceD05I0tm2NvwQOe6QG19sdjy5TmIeH72o='
WHERE
key_id = '1f415f35a02e418a022aa35389a501de5da28071c18ffd7449154c74f3152caa'
AND (
token = '2xd7z1sPNceD05I0tm2NvwQOe6QG19sdjy5TmIeH72o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)