UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RHw9W752QnvVUrnQVVFJVw1M3xdK6dsWkZd1Rg+JAlM='
WHERE
key_id = 'd21e2366f78767bda31b7a121713af7ad1e7ae3aaf0d26ae2c272b9e541baa77'
AND (
token = 'RHw9W752QnvVUrnQVVFJVw1M3xdK6dsWkZd1Rg+JAlM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)