UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kkVyyzsoooyIY+0IPJc7uEU00bR8HDaq+8YLKVyd3pw='
WHERE
key_id = 'c06b17d57c9132fd4f8a4a204beaae2e5d27ee7e0ee403148e79fc6e789cfa70'
AND (
token = 'kkVyyzsoooyIY+0IPJc7uEU00bR8HDaq+8YLKVyd3pw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)