UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DZuYqQ5Mlp6Fh+j5aF/zjw4rovKsZV7MMYM+z6bFLs8='
WHERE
key_id = 'b35e91b9aa2b87957368b6cd510154f56c1c43b535357e62234aa0f27c9749e4'
AND (
token = 'DZuYqQ5Mlp6Fh+j5aF/zjw4rovKsZV7MMYM+z6bFLs8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)