UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MLlqyLk5tO7433WgJ1onxVK9ZoaIMHrwg8JViPQ7DzQ='
WHERE
key_id = 'a3921df343a46c23d44ce3520c5f4879680415910f574115011dac979ce8af4f'
AND (
token = 'MLlqyLk5tO7433WgJ1onxVK9ZoaIMHrwg8JViPQ7DzQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)