UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PygfbWwXxLuEgGKisUN3oYbSiNtGX5FKRGAJ15yXP7c='
WHERE
key_id = '588bf8034455bcdc7a724ef8da6e01fcd41eed2f4c1825721c5b6f79e56fff79'
AND (
token = 'PygfbWwXxLuEgGKisUN3oYbSiNtGX5FKRGAJ15yXP7c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)