UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KEt/JzrNFQQ0PQqtCp5X/x4KFvKXodUulIxdhd8DAxQ='
WHERE
key_id = '5dc6baa8aaa6975cfce8b40725af25d427975d5806a34123f4aef8841f1b1649'
AND (
token = 'KEt/JzrNFQQ0PQqtCp5X/x4KFvKXodUulIxdhd8DAxQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)