UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 't39XaToSXQ1MVW0pEVEFqXJxsFd/FqpN4pdRxIUQ/E4='
WHERE
key_id = '56aefe4274e2d6f41cf33c419640770de2b690c4f5b7727f2ea8f80e213384f8'
AND (
token = 't39XaToSXQ1MVW0pEVEFqXJxsFd/FqpN4pdRxIUQ/E4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)