UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zGzvdFmBbft+Jo7ueS3jader8tW3PldrcqvbTMm9XWY='
WHERE
key_id = '51e8e0c0561bcffb9790da4d0beb7aa99bca5bb54254d98c3b91e9008644a04c'
AND (
token = 'zGzvdFmBbft+Jo7ueS3jader8tW3PldrcqvbTMm9XWY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)