UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pcrjgHbOojS0dxn6e5WJOxtPKtyNmwXTJuow6tBtRC4='
WHERE
key_id = '70d68c66d75c4744dec36070b020953718a86357cff6c42f0bdc9e2d7d363e55'
AND (
token = 'pcrjgHbOojS0dxn6e5WJOxtPKtyNmwXTJuow6tBtRC4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)